<!DOCTYPE html>
<html>
<head>
    <title>{$eju.field.seo_title}</title>
    <meta name="renderer" content="webkit" />
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=0,minimal-ui" />
    <meta name="description" content="{$eju.field.seo_description}" />
    <meta name="keywords" content="{$eju.field.seo_keywords}" />
    <link href="{eju:global name='web_cmspath' /}/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    {eju:static file="skin/css/iconfont.css" /}
    {eju:static file="skin/css/amazeui.min.css" /}
    {eju:static file="skin/css/aflist.css" /}
    {eju:static file="skin/css/mobile2.css" /}

    {eju:static file="skin/js/jquery.min.js" /}
    {eju:static file="skin/js/amazeui.min.js" /}
    {eju:static file="skin/js/iscroll.js" /}
    {eju:static file="skin/js/swiper-3.4.2.jquery.min.js" /}
    {eju:static file="skin/js/amazeui.lazyload.min.js" /}
</head>
<style>
    .input-text{
        border: 1px #CCC solid;
        font-size: 1.45rem;
        float: left;
        width: 100%;
        margin-top: 1.2rem;
        margin-bottom: 1.2rem;
        border-radius: 5px;
        line-height: 3rem;
        height: 3rem;
        padding: 5px;
    }
</style>
<body>
{eju:include file="header.htm"/}

<script type="text/javascript">
    function showTime(tuanid, time_distance) {
        this.tuanid = tuanid;
        //PHP时间是秒，JS时间是微秒
        var timestamp = (new Date()).getTime();
        this.time_distance = time_distance * 1000 - timestamp;
    }
    showTime.prototype.setTimeShow = function () {
        var timer = $("#lefttime_" + this.tuanid);
        var btn_baoming = $("#btn_baoming_" + this.tuanid);
        var str_time;
        var int_day, int_hour, int_minute, int_second;
        time_distance = this.time_distance;
        this.time_distance = this.time_distance - 1000;
        if (time_distance > 0) {
            int_day = Math.floor(time_distance / 86400000);
            time_distance -= int_day * 86400000;
            int_hour = Math.floor(time_distance / 3600000);
            time_distance -= int_hour * 3600000;
            int_minute = Math.floor(time_distance / 60000);
            time_distance -= int_minute * 60000;
            int_second = Math.floor(time_distance / 1000);
            if (int_hour < 10)
                int_hour = "0" + int_hour;
            if (int_minute < 10)
                int_minute = "0" + int_minute;
            if (int_second < 10)
                int_second = "0" + int_second;
            str_time = "<i></i>距离报名结束还有<em class='data-day'>"+int_day + "</em>天<em class='data-hour'>" + int_hour + "</em>小时<em class='data-minute'>" + int_minute + "</em>分钟<em class='data-sec'>" + int_second + "</em>秒";
            timer.html(str_time);
            var self = this;
            setTimeout(function () { self.setTimeShow(); }, 1000); //D:正确
        } else {
            btn_baoming.html("报名结束");
            btn_baoming.prop("class","span-end");
            btn_baoming.attr("data-am-modal","");
            $("#nav_baoming").remove();
            timer.text("结束");
            return;
        }
    }
</script>
<div class="kft-detail-info">
    {eju:arcview aid="$eju.field.joinaid" addfields="discount" id="view"}
        {eju:notempty name="$view.is_discount"}
        <div class="detail-info-head">
            <h3>[优惠]{$view.discount}</h3>
        </div>
        {/eju:notempty}
        <div class="detail-info-pic"> <img src="{$eju.field.litpic}" /> </div>
        <div class="detail-info-part">
            <div class="info-part-wrap"> <a class="info-part-btn" href="{$view.arcurl}">{$view.title}></a>
                <span class="info-part-bmnum">已有{$eju.field.apply_num}人报名</span>
                <div class="clear"></div>
            </div>
            <p class="info-part-area">地址：{$view.address}</p>
        </div>
    {/eju:arcview}

    <div class="detail-info-bm">
        <div class="info-bm-data am-u-sm-9">
            <p class="bm-data-time" id="lefttime_1"></p>
            <p class="bm-data-over">活动时间：{$eju.field.begin_time|myDate="Y年m月d日",###}-{$eju.field.end_time|myDate="Y年m月d日",###}</p>
        </div>
        <div class="info-bm-btn am-u-sm-3"> <span id="btn_baoming_1" data-am-modal="{target:'#af-user-yy'}">立即报名</span> </div>
        <div class="clear"></div>
    </div>
</div>
<div class="kft-detail-wrap"> <span class="detail-wrap-head">活动详情</span>
    {$eju.field.content}
</div>
<div data-am-widget="navbar" class="am-navbar am-cf am-navbar-default " id="">
    <ul class="am-navbar-nav am-cf am-avg-sm-4">
        <li id="nav_baoming" style="border-right: 1px solid #fff;">
            <a href="javascript: void(0)" data-am-modal="{target:'#af-user-yy'}">
                <span class="iconfont icon-time kft-yy" style="display: inline-block;"></span>
                <span class="am-navbar-label" style="display: inline-block;font-size: 18px;">预约看房</span>
            </a>
        </li>
        <!--<li>-->
            <!--<a href="">-->
                <!--<span class="iconfont icon-geren kft-jjr" style="display: inline-block;"></span>-->
                <!--<span class="am-navbar-label" style="display: inline-block;font-size: 18px;">在线咨询</span>-->
            <!--</a>-->
        <!--</li>-->
    </ul>
</div>
<script type="text/javascript">
    var st = new showTime(1,"{$eju.field.end_time}");
    st.setTimeShow();
</script>
<div class="am-modal am-modal-prompt" tabindex="-1" id="af-user-yy">
    <div class="am-modal-dialog" style="width: 100%;height: 40%;">
        {eju:form formid="1" success="closemodal"}
        <form method="post" id="{$field.form_name}" action="{$field.action}" onsubmit="{$field.submit}">
            <div class="am-modal-hd">预约看房 </div>
            <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close="" style="top: 4px;right: 4px;position: absolute">×</a>
            <p class="am-modal-text">24小时接送机，住宿安排，专车看房，全程免费</p>
            <input type="text" class="input-text" id="{$field.attr_1}" name="{$field.attr_1}" placeholder="{$field.itemname_1}" >
            <button type="submit" id="yuyue_btn_sub" class="am-btn am-btn-warning af-yyzx">免费预约</button>
            {$field.hidden}
        </form>
        <script>
            function closemodal(){
                $(".layui-layer-loading1").hide();
                $(".am-modal,.am-dimmer").hide();
                $("body").removeClass("am-dimmer-active");
            }
        </script>
        {/eju:form}
    </div>
</div>
{eju:static file="skin/layer/layer.min.js" /}
<script>
    $(function() {
        $(".yhsq_m5 a").click(function(){
            $(".am-modal-hd,#yuyue_btn_sub").text($(".yhsq_m5 a").text());
            $(".am-modal-dialog #type").val(3);
        });
        $(".am-navbar-label").click(function(){
            $(".am-modal-hd,#yuyue_btn_sub").text($(".am-navbar-label").eq(1).text());
            $(".am-modal-dialog #type").val(1);
        });
    });
</script>
</body>
</html>